package com.example.administrator.taxicar.ui.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.EditText;
import android.widget.Toast;

import com.example.administrator.taxicar.R;

/**
 * Created by Administrator on 2016/4/28.
 */
public class FankuiActivity extends Activity implements View.OnClickListener {

    private EditText memo, user_mailorcall;
    private String neirong, user_call;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); //声明使用自定义标题
        setContentView(R.layout.activity_fankui_layout);
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.fankui_titlebar_layout);//自定义布局赋

        inint();
    }

    public void inint() {
        memo = (EditText) findViewById(R.id.memo);
        user_mailorcall = (EditText) findViewById(R.id.user_mailorcall);

        findViewById(R.id.title_left_img).setOnClickListener(this);
        findViewById(R.id.title_right_img).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.title_left_img:
                finish();
                break;
            case R.id.title_right_img:
                if (memo.getText().equals("")||memo.getText().length()==0||memo.getText().toString()==null){
                    Toast.makeText(getApplicationContext(), "请填写反馈内容", Toast.LENGTH_SHORT).show();
                } else {
                    user_call = user_mailorcall.getText().toString();
                    neirong = memo.getText().toString();
                    Toast.makeText(getApplicationContext(), "反馈成功", Toast.LENGTH_SHORT).show();
                    finish();
                }
                break;
        }
    }
}
